/*
 * PCMDataBlock.h
 *
 *  Created on: Nov 24, 2011
 *      Author: shaohong
 */

#ifndef PCMDATABLOCK_H_
#define PCMDATABLOCK_H_

namespace nmps {

class PCM_Data_Block {
public:
	PCM_Data_Block(int size);

	// return the size of the PCM data contained in this block
	int getDataSize() const;

	// return the data contained in this block
	char * getPcmData();

	/**
	 * Copy the PCM data contained in this block to the targetMem.
	 * The data copied is between the range [startPos, endPos)
	 */
	void getPcmData(int startPos, int endPos, char * targetMem);

	/*
	 * Save the data pointed by pcmData into this PCMDataBlock
	 */
	void setPcmData(unsigned char * pcmdata);

	virtual ~PCM_Data_Block();

private:
	int dataSize;
	char * pcmData;
};

} /* namespace nmps */
#endif /* PCMDATABLOCK_H_ */
